package com.digitalchina.lxnsy.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.digitalchina.lxnsy.R;
import com.digitalchina.lxnsy.base.BaseAdapter;
import com.digitalchina.lxnsy.entity.WinningVO;

import java.util.List;


/**
 * ================================================
 * 项目名称：YLCloud
 * 类描述：
 * 包名：com.digitalchina.ylcloud.adapter
 * 创建人：郑皓
 * 创建时间：2016/9/26 20:43
 * 修改备注：
 * ================================================
 */
public class WinningListAdapter extends BaseAdapter<WinningListAdapter.WinningHolder, WinningVO> {


    public WinningListAdapter(Context context, List<WinningVO> listData) {
        super(context, listData);
    }

    @Override
    public View buildConvertView(LayoutInflater layoutInflater, ViewGroup parent) {
        return inflate(R.layout.item_winning, parent);
    }

    @Override
    public WinningHolder buildHolder(View convertView) {
        WinningHolder holder = new WinningHolder();
        holder.tvName = (TextView) convertView.findViewById(R.id.winning_tv_name);
        holder.tvPrize = (TextView) convertView.findViewById(R.id.winning_tv_prize);
        return holder;
    }

    @Override
    public void bindViewData(WinningHolder holder, WinningVO winningVO, int position) {

        holder.tvName.setText("恭喜 " + winningVO.getTel());
        holder.tvPrize.setText(winningVO.getGiftName() + "");

    }

    class WinningHolder {

        TextView tvName;
        TextView tvPrize;

    }
}
